import dashscope
from dashscope import TextEmbedding
from dashvector import Client, Doc

dashscope.api_key = 'sk-39e47712f94a4816a18f356dd26aa1c8'
client = Client(
    api_key='sk-hz4xtal1OMo24Ft7hLC1EQdSZimEw6918B4CE47C911EF90AA2A0812EF32E2',
    endpoint='vrs-cn-j4g3ukace0004v.dashvector.cn-hangzhou.aliyuncs.com'
)
#
def delete_vector(collection, vector_id):
    collection = client.get(name=collection)
    ret = collection.delete(vector_id)
    # 判断delete接口是否成功
    if ret.code != 200:
        return ret.output
    else:
        return ret.output


